tiff to omezarr and nrrd to precomputed converters#6
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds two converter tools for preparing 3D image data for visualization in Neuroglancer: a TIFF to OME-Zarr converter and an NRRD to Neuroglancer Precomputed converter. Both converters support volumetric data processing, multichannel handling, and mesh generation for segmentation visualization.
Changes:
- Added TIFF to OME-Zarr converter with multichannel support and diagnostic tools
- Added NRRD to Precomputed converter with mesh generation and segment property management
- Included utility scripts for data inspection, validation, and troubleshooting
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| converters/tif_to_omezarr/diagnose_tiff.py | Diagnostic tool for visualizing TIFF files and checking for black image issues |
| converters/tif_to_omezarr/converter.py | Main converter for TIFF to OME-Zarr with multichannel support and pyramid generation |
| converters/tif_to_omezarr/check_tiff_stats.py | Utility to inspect TIFF metadata and data statistics |
| converters/tif_to_omezarr/README.md | Documentation for TIFF to OME-Zarr converter usage |
| converters/nrrd_to_precomputed/meshes_generator_parallel.py | Parallel mesh generation for precomputed segmentation volumes |
| converters/nrrd_to_precomputed/meshes_generator.py | Mesh generation with physical coordinate transformation and merging options |
| converters/nrrd_to_precomputed/merge_segments.py | Tool for merging fragmented segments using connected component analysis |
| converters/nrrd_to_precomputed/inspect_nrrd.py | Utility to inspect NRRD file contents and identify segmentation issues |
| converters/nrrd_to_precomputed/converter.py | Main converter for NRRD to Neuroglancer Precomputed format |
| converters/nrrd_to_precomputed/check_mesh_coords.py | Debug tool for verifying mesh and volume coordinate spaces |
| converters/nrrd_to_precomputed/README.md | Documentation for NRRD to Precomputed workflow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| zarrdir = Path(args.output_zarr_ome_dir) | ||
| if zarrdir.suffix != ".zarr": | ||
| print("Name of ouput zarr directory must end with '.zarr'") |
There was a problem hiding this comment.
Corrected spelling of 'ouput' to 'output'.
| print("Name of ouput zarr directory must end with '.zarr'") | |
| print("Name of output zarr directory must end with '.zarr'") |
| print(f"Successfully wrote {ds_name}") | ||
| print(f" Encoding: {encoding}") | ||
| print( | ||
| f" Compression: {'gzip (. gz files)' if compress else 'none (raw files)'}" |
There was a problem hiding this comment.
Extra space in '. gz' should be '.gz'.
| f" Compression: {'gzip (. gz files)' if compress else 'none (raw files)'}" | |
| f" Compression: {'gzip (.gz files)' if compress else 'none (raw files)'}" |
| if not is_planar_ome: | ||
| if keep_channels: | ||
| print("Image is single-channel") | ||
| if channel is not None and channel != 0 and not is_planar_ome: |
There was a problem hiding this comment.
The condition not is_planar_ome is checked twice in this block (lines 355 and 358). Consider restructuring to avoid redundancy.
| if channel is not None and channel != 0 and not is_planar_ome: | |
| if channel is not None and channel != 0: |
| num_workers = min( | ||
| 4, max(1, cpu_count() - 2) | ||
| ) # Use max 4 workers, leave 2 cores free |
There was a problem hiding this comment.
Magic numbers 4 and 2 should be defined as named constants for better maintainability.
No description provided.